package router

import (
	"jgt-oper/src/context"
	"jgt-oper/src/share"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
)

// ShareAuthCodeMap 注册路由映射
func ShareAuthCodeMap(g *inject.Graph, r *gear.Router) {
	a := new(share.AuthCode)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}

	r.Get("/auth_codes/:id", context.WrapContext(a.Get))
}
